<%@ include file="/taglibs.jsp" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<head>
	<title>北京邮电大学学生党员在线学习中心</title>
	
	<link type="text/css" rel="stylesheet" href="${ctx}/css/jquery-ui-1.8.16.custom.css" />
	
	<script type="text/javascript" src="${ctx}/scripts/jquery-1.6.2.js"></script>
	<script type="text/javascript" src="${ctx}/scripts/jquery-ui-1.8.16.custom.min.js"></script>
	<script type="text/javascript" src="${ctx}/scripts/jquery.ui.core.js"></script>
	<script type="text/javascript" src="${ctx}/scripts/jquery.ui.datepicker.js"></script>
	
	<!-- 验证密码开始 -->
	<script type="text/javascript">
	
		function checkPwd(passwd){
			
		    var repPass = /^[0-9a-zA-Z]{6,16}$/; //检查密码
		    var repPass1 = /[0-9]{1,}/; //数字
		    var repPass2 = /[a-zA-Z]{1,}/; //字母
		    
		    
		    if(!repPass.test(passwd) || !repPass1.test(passwd) || !repPass2.test(passwd)){//检查密码
		       
		        return 1;
		    }   
		   
				return 2;//合法密码
		} 
	
	</script>
	<!-- 验证密码结束 -->
	
	
	<script type="text/javascript">
	String.prototype.trim = function()
	{
	  return this.replace(/(^\s*)|(\s*$)/g, "");
	}
	
	function check() {
		   var oldPassword = document.form1.oldPassword.value.toString();
		   var newPassword = document.form1.newPassword.value.toString();
		   var newPassword2 = document.form1.newPassword2.value.toString();
		   
		   var result = checkPwd(newPassword);
		   
 	   if(oldPassword.trim().length == 0) {
		       alert('请输入旧密码！');
		       document.form1.oldPassword.focus();
		       return false;
		       
		   }else if(result==1){
				 alert('新密码格式不正确，请设置密码为6~20位字母与数字的组合!');
				 document.form1.newPassword.focus();
				 return false;
				 
			}else if(newPassword2.trim().length == 0) {
		       alert('请再次输入新密码！');
		       document.form1.newPassword2.focus();
		       return false;
		        
		   } else if(newPassword!=(newPassword2)) {
		       alert('两次输入的新密码不一致！');
		       document.form1.newPassword2.focus();
		       return false;
		   } 
	
		}
				
	
	</script>
	
</head>
<div id="nav_bar">
    <img id="nav_bar_left" src="../../../styles/nav_bar_left.png" alt=""/>
    <div id="welcome_label">欢迎您，&nbsp;<s:property value="#session.session_user.adminName" />!</div>
    <img id="nav_bar_seperator" src="../../../styles/nav_bar_seperator.png" alt=""/>
    <div id="nav_location">
        <img id="nav_bar_point" src="../../../styles/nav_bar_point.png" alt="" />
        <div id="nav_cur_location">当前位置：&nbsp;<a href="${ctx}/AdminAction_adminPersonCenter">个人中心</a>&nbsp;&nbsp;>&nbsp;&nbsp;<span style="color:black;">修改个人密码</span></div>
    </div>
    <img style="float:right; width:5px;" src="../../../styles/nav_bar_right.png" alt=""/>
    <a id="nav_logout" href="${ctx}/logoutAction_adminLogout">[安全退出]</a>
</div>
<div style="clear:both; height:5px;">&nbsp;</div>

<div style="min-height:450px;">
	<div id="side_menu">
	    <div id="side_menu_title">
	        <img src="../../../styles/side_menu_title_img.png" alt="" />
	        <span>个人中心</span>
	    </div>
	    <div id="side_menu_title_bottom">&nbsp;</div>
	    <div class="side_sub_menu">
	        <div class="side_menu_point">&nbsp;</div>
	        <a href="${ctx}/AdminAction_adminInfo">查改个人信息</a>
	    </div>
	    <div class="side_menu_seperator">&nbsp;</div>
	    <div class="side_sub_menu_focus">
	        <div class="side_menu_point">&nbsp;</div>
	        <a href="${ctx}/AdminAction_modifyAdminPassword">修改个人密码</a>
	    </div>
	    <div class="side_menu_seperator">&nbsp;</div>
	    <div class="side_sub_menu">
	        <div class="side_menu_point">&nbsp;</div>
	        <a href="${ctx}/AdminAction_personStudyStatistics">个人学习情况统计</a>
	    </div>
	    <div class="side_menu_seperator">&nbsp;</div>
	    <s:if test="#session.level == 2 || #session.level == 3">
	    <div class="side_sub_menu">
	        <div class="side_menu_point">&nbsp;</div>
	        <a href="${ctx}/AdminAction_branchStudyStatistics">党支部学习情况统计</a>
	    </div>
	    </s:if>
	    <s:if test="#session.level == 3">
	    <div class="side_menu_seperator">&nbsp;</div>
	    <div class="side_sub_menu">
	        <div class="side_menu_point">&nbsp;</div>
	        <a href="${ctx}/AdminAction_partyStudyStatistics">分党委学习情况统计</a>
	    </div>
	    </s:if>
	</div>
	
	<div id="main_content">
	    <div id="main_content_title">
	        <img src="../../../styles/content_title_img.png" alt="" />
	        <span>修改个人密码</span>
	    </div>
	    <div class="main_content_title_bottom">&nbsp;</div>
		<form action="AdminAction_save_modifyAdminPassword" name="form1" method="post"  onsubmit="return check();">
			<table id="table" class="page_table" cellspacing="0" cellpadding="0" >
			<tr>
				<td class="leftTD">旧密码:
				</td>
				<td class="rightTD"><input type="password"  id="oldPassword"   name="oldPassword"  value=""  /><font color="red">*</font></td>
			</tr>
			<tr>
				<td class="leftTD2">新密码:</td>
				<td class="rightTD"><input type="password"  id="newPassword" name="newPassword"  value=""  /><font color="red">*</font></td>
			</tr>
			<tr>
				<td class="leftTD">再次输入新密码:</td>
				<td class="rightTD"><input type="password"  id="newPassword2" name="newPassword2"  value=""  /><font color="red">*</font></td>
			</tr>
			</table>
			<div style="clear:both; height:5px;"></div>
			<div style="text-align:center; width:90%;">
				<input type="submit"  name="submit" id="submit" class="input-button" value="提交"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="reset"  name="reset" id="button" class="input-button"  value="重置"/>
			</div>
		</form>
	</div>
</div>
